/*
* @Author: LENOVO
* @Date:   2017-11-21 15:08:40
* @Last Modified by:   LENOVO
* @Last Modified time: 2017-11-22 15:29:15
*/
var mongoose = require('mongoose');

var userSchema = new mongoose.Schema({
	"userId":String,
	"userName":String,
	"userPwd":String,
	"orderList":Array,
	"cartList":[{
		"productId":String,
		"productName":String,
		"salePrice":String,
		"productImage":String,
		"checked":String,
		"productNum":String
	}],
	"addressList":[
    {
      "addressId": String,
      "userName": String,
      "streetName": String,
      "postCode": Number,
      "tel": Number,
      "isDefault": Boolean
    }
  ]
});

module.exports = mongoose.model("User", userSchema,"users");